<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!-- QnA 게시판 -->
<!DOCTYPE HTML>
<html>		
<head>
<style type="text/css">
table{
	width: 1000px;	
}
th,td{	
	text-align: center;
}
.title_form{
	text-align: left;
}

#notice{
	border-bottom-style:inset;
	font-size:x-large;
}
</style>
<title>게시판</title>
</head>
<div class="qnaBoard" style="width: 1100px">		
<%--  
	<table id="qnaTable" class="${Shop_blogVO.blog_style}">
		<caption style="text-align: right;">		
 --%> 		
<!-- QA 게시판 -->  	
 	<table id="qnaTable" class="table table-striped">
		<caption style="text-align: right;" align="top">
		
		
		<!-- 검색폼 -->
		<s:url id="formurl" value="blogMain.action?shop_seq=%{sessionMap.current_shop_seq}" />		
		<s:form name="pagingForm" method="post" action="%{formurl}"	theme="simple">		
		<s:hidden name="currentPage" value="%{pagenavi.currentPage}" />
		<a class="text-left">총 게시물 : <span class="badge"><s:property value="pagenavi.totalRecordsCount" /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>		
		<span class = "glyphicon glyphicon-search"></span> <s:textfield name="searchText" class="form-control input_lg" placeholder = "제목을 입력하세요."  size="60"/>
		<input type="button" value="검색" class = "btn btn-default" onclick="javascript:pagingFormSubmit(1)">
		<!-- 글쓰기 버튼 -->			
		<input type="button" value="글쓰기"	class = "btn btn-default" onClick="location.href='<s:url value="javascript:openWriteForm()" />'" />
						
	</s:form>
	<!-- 검색폼 종료 -->		
		</caption>
		
		<!-- 공지사항 -->
		<tr id = "notice">
			<td style="color: #ff4500; font: 25px cursive ;">공지사항</td>
			<td style="color: #ff4500; font: 25px cursive ;">
			<s:if test="noticeVO.notice_title != null">	<s:property value = "noticeVO.notice_title"></s:property></s:if>
			<s:else><td style="color: #000000; font: 25px cursive ;">	정성을 다하여 모시겠습니다.	</td></s:else>
			<td style="color: #000000; font: 25px cursive ;"></td>
			<td></td>
		</tr>
		
		<tr>
			<th>번호</th>
			<th class = "title_form">제목</th>
			<th>작성자</th>
			<th>등록일</th>
		</tr>
		
		<!-- 게시물 반복 시작 -->
		<s:iterator value="shop_qa_list" status="status">
			<tr >
				<td><s:property value="qa_seq" /></td>
				<td class = "title_form"><s:url id="readurl" value="qaRead.action">
						<s:param name="qa_seq" value="%{qa_seq}" />
					</s:url> <s:a href="%{readurl}">
						<s:property value="qa_title" />
					</s:a></td>
				<td><s:property value="customer_id" /></td>
				<td><s:property value="inputdate" /></td>
			</tr>
		</s:iterator>
		<!-- 반복 끝 -->
	</table>
	<!-- 페이지 이동 시작 -->
	<p style="text-align: center; ">				
	<!-- 페이지 좌로 이동 -->
	<a href="javascript:pagingFormSubmit(${pagenavi.currentPage - pagenavi.pagePerGroup})">◁◁</a> &nbsp;&nbsp;
	<a href="javascript:pagingFormSubmit(${pagenavi.currentPage - 1})">◀</a>&nbsp;&nbsp;
		<!-- 페이지 반복 -->
		<s:iterator var="counter" begin="pagenavi.startPageGroup"	end="pagenavi.endPageGroup">	
		<s:if test="pagenavi.endPageGroup !=0">	
			<a href="javascript:pagingFormSubmit(<s:property value="#counter"/>)"><s:property	value="#counter" /></a>&nbsp;
		</s:if>	
		</s:iterator>	
	<!-- 페이지 우로 이동 -->
	&nbsp;&nbsp;	<a href="javascript:pagingFormSubmit(${pagenavi.currentPage + 1})">▶</a>
	&nbsp;&nbsp;	<a href="javascript:pagingFormSubmit(${pagenavi.currentPage + pagenavi.pagePerGroup})">▷▷</a>
	<!-- /페이지 이동 끝 -->
	</p>
	
	<!-- 페이지 이동 스크립트  -->
	<script>
		function pagingFormSubmit(currentPage) {
			document.pagingForm.currentPage.value = currentPage;
			document.pagingForm.submit();
		}
		function openWriteForm() {
			var customer_id ="${customer_id}"; 
			if( customer_id == "")
				alert("로그인 후 작성 가능합니다.");
			else
				window.open("jangdolbang2/board/goBoardWriteForm.action",'QnA Write',"width=490, height=330");
		}	
	</script>		
</div>
</html>